<!-- 回退组件 -->
<template>
  <div class="rollback">
    <router-link tag="div" :to="to" class="rollback-btn">
      <van-icon name="arrow-left" />
    </router-link>
    <div class="title">
      <h2>{{ title }}</h2>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: String,
    to: String,
  },
};
</script>

<style lang="scss" scoped>
.rollback {
  width: 100vw;
  height: 2.5rem;
  border-bottom: 1px solid #e9e9e9;
  display: flex;
  position: relative;
  background-color: #fff;
  .rollback-btn {
    width: 10vmin;
    height: 10vmin;
    text-align: center;
    line-height: 10vmin;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
  }
  .title {
    margin: 0 auto;
    height: 100%;
    text-align: center;
    line-height: 2.5rem;
  }
}
</style>
